package com.tspp.dao;

/**
 * Enum for type of user
 * @author Maks
 */
public enum UserType {
    HEAD, ENTRANTSACCEPTOR, EXAMRESULTSRECORDER, PROFFESIONACCOUNTER;

    /**
     * Getting user type from integer value which is read from database
     * @param type integer value which is read from database
     * @return user type
     */
    public static UserType getType(int type) {
        switch (type) {
            case 0:
                return HEAD;
            case 1:
                return ENTRANTSACCEPTOR;
            case 2:
                return EXAMRESULTSRECORDER;
            case 3:
                return PROFFESIONACCOUNTER;
            default:
                return null;
        }
    }
}
